<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__usb__dev__ep0.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">EP0<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a> &raquo; <a class="el" href="group__group__hal__usb__dev.html">USB Device</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >APIs relating specifically to management of endpoint zero. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga93190959ddbaefb2e30e75a1a6885e10"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#ga93190959ddbaefb2e30e75a1a6885e10">cyhal_usb_dev_ep0_get_max_packet</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj)</td></tr>
<tr class="memdesc:ga93190959ddbaefb2e30e75a1a6885e10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get wMaxPacketSize of endpoint 0.  <a href="group__group__hal__usb__dev__ep0.html#ga93190959ddbaefb2e30e75a1a6885e10">More...</a><br /></td></tr>
<tr class="separator:ga93190959ddbaefb2e30e75a1a6885e10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad98fe1fa89cbe51de9c24d90ae78ca82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#gad98fe1fa89cbe51de9c24d90ae78ca82">cyhal_usb_dev_ep0_setup_read_result</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gad98fe1fa89cbe51de9c24d90ae78ca82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the contents of the SETUP packet.  <a href="group__group__hal__usb__dev__ep0.html#gad98fe1fa89cbe51de9c24d90ae78ca82">More...</a><br /></td></tr>
<tr class="separator:gad98fe1fa89cbe51de9c24d90ae78ca82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf3c828aad37e59431b8dd734c8e79780"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#gaf3c828aad37e59431b8dd734c8e79780">cyhal_usb_dev_ep0_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gaf3c828aad37e59431b8dd734c8e79780"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start receiving a packet of up to wMaxPacketSize on endpoint 0.  <a href="group__group__hal__usb__dev__ep0.html#gaf3c828aad37e59431b8dd734c8e79780">More...</a><br /></td></tr>
<tr class="separator:gaf3c828aad37e59431b8dd734c8e79780"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6f8f56c7c2a40d142fc10495a7583697"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#ga6f8f56c7c2a40d142fc10495a7583697">cyhal_usb_dev_ep0_read_result</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj)</td></tr>
<tr class="memdesc:ga6f8f56c7c2a40d142fc10495a7583697"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read the contents of a received packet.  <a href="group__group__hal__usb__dev__ep0.html#ga6f8f56c7c2a40d142fc10495a7583697">More...</a><br /></td></tr>
<tr class="separator:ga6f8f56c7c2a40d142fc10495a7583697"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf4cbc8acf3bea0a4248f637a9bc2b41c"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#gaf4cbc8acf3bea0a4248f637a9bc2b41c">cyhal_usb_dev_ep0_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj, uint8_t *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gaf4cbc8acf3bea0a4248f637a9bc2b41c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a packet on endpoint 0.  <a href="group__group__hal__usb__dev__ep0.html#gaf4cbc8acf3bea0a4248f637a9bc2b41c">More...</a><br /></td></tr>
<tr class="separator:gaf4cbc8acf3bea0a4248f637a9bc2b41c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54286f06390fdf46d68394de79d1cf2d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__usb__dev__ep0.html#ga54286f06390fdf46d68394de79d1cf2d">cyhal_usb_dev_ep0_stall</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *obj)</td></tr>
<tr class="memdesc:ga54286f06390fdf46d68394de79d1cf2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Protocol stall on endpoint 0.  <a href="group__group__hal__usb__dev__ep0.html#ga54286f06390fdf46d68394de79d1cf2d">More...</a><br /></td></tr>
<tr class="separator:ga54286f06390fdf46d68394de79d1cf2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga93190959ddbaefb2e30e75a1a6885e10" name="ga93190959ddbaefb2e30e75a1a6885e10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga93190959ddbaefb2e30e75a1a6885e10">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_get_max_packet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_usb_dev_ep0_get_max_packet </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get wMaxPacketSize of endpoint 0. </p>
<p >The endpoint 0 has dedicated buffer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The size allocated for endpoint 0 </dd></dl>

</div>
</div>
<a id="gad98fe1fa89cbe51de9c24d90ae78ca82" name="gad98fe1fa89cbe51de9c24d90ae78ca82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad98fe1fa89cbe51de9c24d90ae78ca82">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_setup_read_result()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_usb_dev_ep0_setup_read_result </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read the contents of the SETUP packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Buffer to fill with data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of buffer passed in </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaf3c828aad37e59431b8dd734c8e79780" name="gaf3c828aad37e59431b8dd734c8e79780"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf3c828aad37e59431b8dd734c8e79780">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_usb_dev_ep0_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start receiving a packet of up to wMaxPacketSize on endpoint 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Buffer to fill with the data read </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of buffer </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6f8f56c7c2a40d142fc10495a7583697" name="ga6f8f56c7c2a40d142fc10495a7583697"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6f8f56c7c2a40d142fc10495a7583697">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_read_result()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_usb_dev_ep0_read_result </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read the contents of a received packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Actual number of bytes that was read </dd></dl>

</div>
</div>
<a id="gaf4cbc8acf3bea0a4248f637a9bc2b41c" name="gaf4cbc8acf3bea0a4248f637a9bc2b41c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf4cbc8acf3bea0a4248f637a9bc2b41c">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_usb_dev_ep0_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write a packet on endpoint 0. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>Buffer fill with data to send </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of data to send</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes that were written. </dd></dl>

</div>
</div>
<a id="ga54286f06390fdf46d68394de79d1cf2d" name="ga54286f06390fdf46d68394de79d1cf2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga54286f06390fdf46d68394de79d1cf2d">&#9670;&nbsp;</a></span>cyhal_usb_dev_ep0_stall()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_usb_dev_ep0_stall </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__usb__dev__t">cyhal_usb_dev_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Protocol stall on endpoint 0. </p>
<p >Stall all IN and OUT packets on endpoint 0 until a SETUP packet is received.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The USB device object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>The stall is cleared automatically when a setup packet is received </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
